import require from '@/utils/require'

/**
 * 获取所有角色的列表
 * @returns
 */
export const roleList = () => {
  return require({
    url: 'role/list'
  })
}

/**
 * 获取指定角色权限列表
 * @returns
 */
export const rolePermission = (roleId) => {
  return require({
    url: `role/permission/${roleId}`
  })
}

/**
 * 获取指定角色权限列表
 * @returns
 */
export const distributePermission = (roleId, permissions) => {
  return require({
    url: 'role/distribute-permission',
    method: 'post',
    data: {
      roleId,
      permissions
    }
  })
}
